package com.supermap.gwfs.datashare.endpoint;

import javax.annotation.Resource;

import com.supermap.gwfs.datashare.param.ResponseData;
import com.supermap.gwfs.datashare.of.service.GridDataService;
import com.supermap.gwfs.datashare.util.PageData;
import io.spring.guides.gs_producing_web_service.*;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

/**
 * @author zhoujian
 * @version V1.0
 * @Description: TODO
 * @date 2017-6-12
 */
@Endpoint
public class GridForecastEndPoint{

    private static final String NAMESPACE_URI = "http://spring.io/guides/gs-producing-web-service";

    @Resource
    private GridDataService gridDataService;

    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "XXZX_GRID_GetNafpEleGridInRectByTimeAndLevelAndValidTimeRequest")
    @ResponsePayload
    public XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidTimeResponse getNafpEleGridInRectByTimeAndLevelAndValidTime(@RequestPayload XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidTimeRequest request) {
        XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidTimeResponse response = new XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidTimeResponse();
        PageData pd = new PageData(request);
        ResponseData data = this.gridDataService.getNafpEleGridInRectByTimeAndLevelAndValidtime(pd);
        response.setStatus(data.getStatus());
        response.setMsg(data.getMsg());
        response.setData((String) data.getData());
        return response;
    }

    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "XXZX_GRID_GetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationIdRequest")
    @ResponsePayload
    public XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationIdResponse getNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationId(@RequestPayload XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationIdRequest request) {
        XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationIdResponse response = new XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationIdResponse();
        PageData pd = new PageData(request);
        ResponseData data = this.gridDataService.getNafpEleGridInRectByTimeAndLevelAndValidAndLon(pd);
        response.setStatus(data.getStatus());
        response.setMsg(data.getMsg());
        response.setData((String) data.getData());
        return response;
    }

    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "XXZX_GRID_GetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeOrAdminCodeRequest")
    @ResponsePayload
    public XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeOrAdminCodeResponse getNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeAndAdminCode(@RequestPayload XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeOrAdminCodeRequest request) {
        XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeOrAdminCodeResponse response = new XXZXGRIDGetNafpEleGridInRectByTimeAndLevelAndValidAndLonAndStationTypeOrAdminCodeResponse();
        PageData pd = new PageData(request);
        ResponseData data = this.gridDataService.getNafpEleGridInRectByTimeAndLevelAndValidAndLon(pd);
        response.setStatus(data.getStatus());
        response.setMsg(data.getMsg());
        response.setData((String) data.getData());
        return response;}

}
